<template>
  <div class="goods_wrap">
    <el-steps :active="active" align-center>
      <el-step title="基本信息"></el-step>
      <el-step title="商品相册"></el-step>
      <el-step title="商品详情"></el-step>
      <el-step title="上架信息"></el-step>
    </el-steps>

    <el-form class="goods_content">
      <el-form
        :model="ruleForm"
        :rules="rules"
        ref="ruleForm"
        label-width="100px"
        class="demo-ruleForm"
      >
        <el-form-item label="名称" prop="name">
          <el-input v-model="ruleForm.name"></el-input>
        </el-form-item>
        <el-form-item label="产品简介" prop="name">
          <el-input v-model="ruleForm.name"></el-input>
        </el-form-item>
        <el-form-item label="类别" prop="region">
          <el-select v-model="ruleForm.region" placeholder="请选择活动区域" style="width:100%">
            <el-option label="酒类" value="shanghai"></el-option>
            <el-option label="其它" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="是否新品" prop="newlabel" style="text-align:left">
          <el-radio-group v-model="ruleForm.newlabel">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="是否热卖" prop="hotlabel" style="text-align:left">
          <el-radio-group v-model="ruleForm.hotlabel">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
    </el-form>
    <el-button type="success" style="margin-top: 12px" @click="next">下一步</el-button>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      active: 0,
      ruleForm: {
        name: "",
        region: "",
        newlabel: 0,
        hotlabel:0
      },
      rules: {
        name: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        region: [
          { required: true, message: "请选择活动区域", trigger: "change" },
        ],
        newlabel: [
          { required: true, message: "请选择活动资源", trigger: "change" },
        ],
        hotlabel: [
          { required: true, message: "请选择活动资源", trigger: "change" },
        ],
      },
    };
  },
  components: {},
  methods: {
    next() {
      if (this.active++ > 2) this.active = 0;
      this.$router.push("/Goodsphoto");
    },
  },
};
</script>

<style scoped>
.goods_wrap {
  width: 100%;
  height: 100%;
  padding: 50px 10px;
  background-color: #fff;
  box-sizing: border-box;
}
.goods_content {
  width: 1200px;
  margin: 0 auto;
  padding: 50px 0px;
  box-sizing: border-box;
}
</style>